﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PMS.SANY.Test
{
    internal class Program
    {
        static void Main(string[] args)
        {
            ConcurrentDictionaryTest cdt = new ConcurrentDictionaryTest();
            var key = "T001";
            if(cdt.LockedOprSeq.TryAdd(key, true))
            {
                Console.WriteLine("==>添加T001成功");
                Console.WriteLine(cdt.LockedOprSeq[key].ToString());
            }

            if (cdt.LockedOprSeq.TryAdd(key, false))
            {
                Console.WriteLine("==>添加T001成功");
                Console.WriteLine(cdt.LockedOprSeq[key].ToString());
            }
            else
            {
                Console.WriteLine("==>添加失败");
                Console.WriteLine(cdt.LockedOprSeq[key].ToString());
            }

            bool value;
            if(cdt.LockedOprSeq.TryRemove(key, out value))
            {
                Console.WriteLine("==>删除成功");
            }
            else
            {
                Console.WriteLine("==>删除失败");
            }


            Console.ReadLine();
        }
    }
}
